package com.wenhai.spring.environment;

import com.wenhai.xiaomage.spring.ioc.overview.dependency.domain.User;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * {@link PropertyPlaceholderConfigurer} 示例
 *
 * @author wenhai
 * @date 2020/9/9
 */
public class PropertyPlaceholderDemo {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:/META-INF/placeholder-resolver.xml");
        User user = ctx.getBean("user", User.class);
        System.out.println(user);

        ((ClassPathXmlApplicationContext) ctx).close();
    }
}
